<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/StaffTemplate.xhtml">

    <ui:define name="content">
        <p:menubar model="#{staffChangeInitialPasswordManagedBean.staffMenuModel}"/>
        <h:form>
            <p:panel id ="viewAllBills" header="View All Bills To Stakeholders">
                <p:dataTable var="paymentManagement" value="#{tCubeManagerBean.paymentManagementList}" paginator="true"
                             rows="12" emptyMessage="No bill has been created" selection="#{reportManagerBean.selectedBill}" 
                             selectionMode="single" rowSelectListener="#{reportManagerBean.onRowSelectNavigateBill}">

                    <p:column sortBy="#{paymentManagement.id}" filterBy="#{paymentManagement.id}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Bill ID" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.id}" />
                    </p:column>

                    <p:column sortBy="#{paymentManagement.stakeholder.corpName}" filterBy="#{paymentManagement.stakeholder.corpName}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Company name" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.stakeholder.corpName}" />
                    </p:column>

                    <p:column sortBy="#{paymentManagement.startDate}" filterBy="#{paymentManagement.startDate}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Start Date" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.startDate}" />
                    </p:column>

                    <p:column sortBy="#{paymentManagement.endDate}" filterBy="#{paymentManagement.endDate}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="End Date" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.endDate}" />
                    </p:column>

                    <p:column sortBy="#{paymentManagement.totalPaymentCurrent}" filterBy="#{paymentManagement.totalPaymentCurrent}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Total Bill" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.totalPaymentCurrent}" />
                    </p:column>

                    <p:column sortBy="#{paymentManagement.paymentReceived}" filterBy="#{paymentManagement.paymentReceived}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Amount Paid" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.paymentReceived}" />
                    </p:column>

                    <p:column sortBy="#{paymentManagement.paymentLeft}" filterBy="#{paymentManagement.paymentLeft}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Amount Left" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.paymentLeft}" />
                    </p:column>

                    <p:column sortBy="#{paymentManagement.dueDate}" filterBy="#{paymentManagement.dueDate}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Due Date" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.dueDate}" />
                    </p:column>
                    <p:column sortBy="#{paymentManagement.expired}" filterBy="#{paymentManagement.expired}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Paid" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.expired}" />
                    </p:column>
                </p:dataTable>
            </p:panel>
            </h:from>
    </ui:define>
</ui:composition>